from django.urls import path
from django.views.generic import TemplateView

from . import views

urlpatterns = [
    path('roles', views.RoleListView.as_view(), name='auth_list'),  # 角色列表
    path('role/create', views.RoleCreateView.as_view(), name='role_create'),  # 添加角色
    path('role/<int:pk>/delete', views.RoleDeleteView.as_view(), name='role_delete'),  # 删除角色
    path('role/<int:pk>/update', views.RoleUpdateView.as_view(), name='role_update'),  # 更新角色

    path('role_user/<int:pk>/link', views.RoleUserLinkView.as_view(), name='role_user_link'),  # 角色用户关联
    path('role_permission/<int:pk>/link', views.RolePermissionLinkView.as_view(),
         name='role_permission_link'),  # 角色权限关联

    # 发布权限列表
    path('push_permission_list', views.PushPermissionListView.as_view(), name='push_permission_list'),
    path('push_permission_member_mgr/<int:pk>/', views.PushPermissionMemberMgrView.as_view(),
         name='push_permission_member_mgr'),  # 发布权限成员管理

    # 服务器权限
    path('host_user_manager_count_list', views.HostUserManagerCountListView.as_view(),
         name='host_user_manager_count_list'),
    path('host_permission/<int:pk>/detail', views.HostPermissionDetailView.as_view(), name='host_permission_detail'),
    path('host_permission/<str:hostip>/<int:userpk>/create', views.HostPermissionCreateView.as_view(),
         name='host_permission_create'),

    # 通过点击ztree中的项目获取主机列表
    path('host_permission_ztree/<str:name>/<str:token>/<str:user>/', views.HostPermissionZtreeView.as_view(),
         name='host_permission_ztree'),

]
